package com.neusoft.neu24.nep.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor

public class CommonResult<T> {
    private Integer code;
    private String msg;
    private  T result;

    public CommonResult(Integer code, String msg, T result)
    {
        this.code = code;
        this.msg = msg;
        this.result = result;
    }

    public CommonResult( T result)
    {
        this.code = 200;
        this.msg = "OK";
        this.result = result;
    }

    public  static <T> CommonResult<T> sucess(  T result )
    {
        return   new CommonResult( result);
    }

    public static CommonResult  filure(HttpCodeEnum systemError) {
        return  new CommonResult(500,"系统内容异常",null);
    }
    public static CommonResult  filure(   ) {
        return  new CommonResult(500,"系统内容异常",null);
    }
}
